//
//  SDDealHouseTableViewController.m
//  Sydeny
//
//  Created by Rainbow on 9/18/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "SDDealHouseTableViewController.h"


@implementation SDDealHouseTableViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle
- (void)viewDidLoad
{
    self.listType = SydenyShopListDealHouse;
    [super viewDidLoad];
    
    UIView *headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 164)] autorelease];
    
    
    SDTwoAdvertisingView *adView = [[SDTwoAdvertisingView alloc] initWithAds:[[CacheData sharedData].advertisings objectForKey:@"4"]];
    adView.delegate = self;
    [headerView addSubview:adView];
    [adView release];
    
    self.tableView.tableHeaderView = headerView;
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (UIView *)tableView:(UITableView *)_tableView viewForHeaderInSection:(NSInteger)section
{

    UIView *bgView = [super tableView:_tableView viewForHeaderInSection:section];
    UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 100, 20)];
    label.backgroundColor = [UIColor clearColor];
    label.textColor = [UIColor whiteColor];
    label.font = [UIFont systemFontOfSize:14];
    label.text = @"房屋买卖";
    [bgView addSubview:label];
    [label release];
    return bgView;
}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}



@end
